package com.jdk8.demo.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * @Description: Stream对象的创建
 */
public class StreamTest1 {
    public static void main(String[] args) {
        // 通过 Stream的of方式创建
        Stream<String> stream1 = Stream.of("hello", "world", "hello world");

        // 通过Arrays类的静态方法stream创建
        String[] arrays = {"hello", "world", "hello world"};
        Stream<String> stream2 = Arrays.stream(arrays);

        List<String> stringList = Arrays.asList(arrays);

        // 通过List集合创建
        Stream<String> stream3 = stringList.stream();


    }
}